{extend name='Public:content'/}
{block name='title'}相册管理{/block}
{block name='content'}
<div class="row animated fadeIn">
    <div class="row">
        <div class="col-md-8">
            <div class="panel panel-default tabs">
                <ul class="nav nav-tabs" role="tablist">
                    <li class="active"><a href="#tab-first" role="tab" data-toggle="tab">相册列表
                        <button class="btn btn-success btn-rounded btn-sm">{$num}</button>
                    </a></li>
                    <li><a href="#tab-second" role="tab" data-toggle="tab">相册添加</a></li>
                </ul>
                <div class="panel-body tab-content">
                    <div class="tab-pane active" id="tab-first">

                        <table id="table-form" class=" table datatable table-hover">
                            <thead>
                            <tr>
                                <th>用户名</th>
                                <th>状态</th>
                                <th>图片</th>
                                <th>创建时间</th>
                                <th></th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr class="del_tr">
                                <td>{$vo.username}</td>
                                <td>{:is_stop($vo.status)}</td>
                                <td>{eq name='vo.is_video' value='1'}
                                    <video src="{$vo.img_url}"></video>{else/}
                                    <img style="max-width: 100px;max-height: 100px;" src="{$vo.img_url}" />{/eq}
                                </td>
                                <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                                <td>
                                    <a title="【编辑】" data-url="{:url('admin/commodity/edit',array('id'=>$vo['id']))}" onclick="edit_row(this)"  class="btn btn-default btn-rounded btn-sm">
                                        <span class="fa fa-pencil"></span>
                                    </a>
                                    <button onClick="delete_row(this);" data-url="{:url('admin/commodity/del',array('id'=>$vo['id']))}" class="btn btn-danger btn-rounded btn-sm" >
                                        <span class="fa fa-times"></span>
                                    </button>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                    <div class="tab-pane" id="tab-second">
                        <form id="add_form"  method="post" action="{:url('admin/album/add')}" class="form-horizontal">
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">相册名称</label>
                                            <div class="col-md-9">
                                                <input name="name" type="text" class="form-control"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">父级相册</label>
                                            <div class="col-md-9">
                                                <select class="form-control select" name="pid">
                                                    <option value="0">请选择</option>
                                                    {volist name="list" id="vo"}
                                                    <option value="{$vo.id}">{$vo.name}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">相册分类</label>
                                            <div class="col-md-9">
                                                <select class="form-control select" name="group_id">
                                                    <option value="0">请选择</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 control-label">描述</label>
                                            <div class="col-md-9 col-xs-12">
                                                <textarea name="describe" class="form-control" rows="5"></textarea>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3  control-label">相册状态</label>
                                            <div class="col-md-9">
                                                <label class="switch">
                                                    <input name="status" type="checkbox" checked value="1"/>
                                                    <span></span>
                                                </label>
                                                <span class="help-block">默认正常</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-footer">
                                <button class="btn btn-info pull-right">保存修改<span class="fa fa-floppy-o fa-right"></span></button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $('#table-form').dataTable({
        "order": [],
    });
</script>
{/block}